package cn.xiuxius.embedded.command.converter;

import cn.xiuxius.embedded.model.IntegerFlashOptionType;
import picocli.CommandLine;

public class IntegerTypeConverter implements CommandLine.ITypeConverter<IntegerFlashOptionType> {
    @Override
    public IntegerFlashOptionType convert(String value) {
        try {
            return IntegerFlashOptionType.from(value.trim().toUpperCase());
        } catch (IllegalArgumentException e) {
            throw new CommandLine.TypeConversionException("Invalid IntegerFlashOptionType value: " + value);
        }
    }
}
